module xenUtils;

import tango.io.Stdout;
import tango.util.collection.ArraySeq;
import tango.util.container.LinkedList;

/*
class Queue(T)
{
	T[] array;
	uint size,increment,length;
	
	this(uint iSize=10)
	{
		increment=iSize;
		array=T[increment];
		size=increment;
		length=0;
	}
	

	void add(T item)
	{
		if (length>=size-1)
		{
			size+=50;
			array.length=size;
		}
		array[length++]=item;
		
	}
	/**********************************************************************

                Index vector entries, where a zero index represents the
                oldest vector entry.

                Throws an exception when the given index is out of range

        ********************************************************************** /

	T pop (uint i)
	{
		if (i < length)
	   {
		   if (i is length-1)
			   return array[--length];
		   --length;
		   auto v = array [i];
		   memmove (array.ptr+i, array.ptr+i+1, T.sizeof * length-i);
		   return v;
	   }
		T x=new T();
		return x;
	}
	
	T opIndex (uint i)
	{
			if (i < length)
				return array [i];
			T x=new T();
			return x;
	}
	T opIndexAssign (T value, uint i)
	{
			if (i < length)
			   {
			   array[i] = value;
			   return value;
			   }
			T x=new T();
			return x;
	}
	}
*/


int main()
{
	int g=5;
	//Vector!(int,g) Q;
	auto Q=new tango.util.container.LinkedList!(int)();
	Q.append(1);
	Q.append(2);
	Q.append(3);
	
	foreach (i;Q)
		Stdout.formatln("content : {}",i);
	
	
	Stdout.formatln("POP : {}",Q.removeTail());
	foreach (i;Q)
		Stdout.formatln("content : {}",i);
	
	
	return 0;
}